/*******************************************************
> Copyright (C) 2024 ==IOT== All rights reserved.
> File Name: usbdev.cpp
> Author: IOT
> Website:www.slq.org
> Created Time: 2024年10月25日 星期五 09时56分42秒
***************************************************/

#include <iostream>
using namespace std;

class UsbDev { // 抽象类, 无法构造对象,一般最顶层的基类
	public:
	    virtual void upload() = 0; // 纯虚函数
		
		void serarchDriver()
		{
			cout << "搜索驱动" << endl;
		}
		void installDriver()
		{
			cout << "安装驱动" << endl;
		}
};

class USBMouse : public UsbDev {
	
};

class USBPrinter : public UsbDev {
	
};

class USBCamera : public UsbDev {
	
};

class Computer {
	public:
		void plug(UsbDev &dev) // 插接
		{
			dev.searchDriver(); // 查找各个设备匹配的驱动
			dev.intallDriver();
		}
};

int main(int argc,const char* argv[])
{

	USBMouse logi_mouse;
	USBPrinter hp_printer;
	USBCamera lacai;
	
	Computer lenovo;
	
	lenovo.plug(lacai);
	
    return 0;
}
